import { HospitalManage } from '../index';
import { MyAXiosRequestConfig } from '../types';

interface ListType {
  data: Object;
}

// 医院分页查询

/**
 *
 * @param offset 分页偏移
 * @param pageNums 每页多少条数据
 * @param config axios配置
 */
const homeHotList = function <T>(offset = 1, pageNums = 10, config?: MyAXiosRequestConfig<T>) {
  return HospitalManage.get<ListType>({
    ...config,
    url: `/${offset}/${pageNums}`,
    interceptor: {
      resSuccessFn(res1) {
        return res1.data;
      },
    },
  });
};

export { homeHotList };
